package com.geeke.sys.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import com.geeke.common.persistence.TreeEntity;

/**
 * 路由表Entity
 */
public class Router extends TreeEntity<Router> {

    private static final long serialVersionUID = 1L;
    
    private String path; // URL-->path
    private String component; // code-->component
    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }
	
	
    public Router() {
        super();
    }
    
    public Router(String id) {
        super(id);
    }

    @Length(min=0, max=64, message="编号长度必须介于0和64之间")
    private String code; // 编号
    
    @Length(min=0, max=128, message="URL长度必须介于0和128之间")
    private String url; // URL
    
    @NotBlank(message="名称不能为空")
    @Length(min=1, max=128, message="名称长度必须介于1和128之间")
    private String name; // 名称
    
    @NotBlank(message="可以授权不能为空")
    @Length(min=1, max=1, message="可以授权长度必须介于1和1之间")
    private String canPermission = "1"; // 可以授权
    
    @NotBlank(message="禁用不能为空")
    @Length(min=1, max=1, message="禁用长度必须介于1和1之间")
    private String isLocked = "0"; // 禁用
    
    @NotBlank(message="扩展属性不能为空")
    @Length(min=1, max=1024, message="扩展属性长度必须介于1和1024之间")
    private String properties; // 扩展属性
    
    @Length(min=0, max=255, message="备注信息长度必须介于0和255之间")
    private String remarks; // 备注信息
    
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
    
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public String getCanPermission() {
        return canPermission;
    }

    public void setCanPermission(String canPermission) {
        this.canPermission = canPermission;
    }
    
    public String getIsLocked() {
        return isLocked;
    }

    public void setIsLocked(String isLocked) {
        this.isLocked = isLocked;
    }
    
    public String getProperties() {
        return properties;
    }

    public void setProperties(String properties) {
        this.properties = properties;
    }
    
    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Override
    public String getTableAlias() {
        return "router";
    }
} 